package com.oascarmovie.model;

import org.json.JSONException;
import org.json.JSONObject;

public class CatalogModel {
  
  private int id;
  private String name;
  
  public int getId() {
    return id;
  }
  public void setId(int id) {
    this.id = id;
  }
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }
  
  public static CatalogModel build(JSONObject catalogJSON) throws JSONException {
    CatalogModel catalogModel = new CatalogModel();
    int id = catalogJSON.getInt("id");
    String nameCn = catalogJSON.getString("nameCn"); 
    
    catalogModel.setId(id);
    catalogModel.setName(nameCn);
    
    return catalogModel;
  }

}
